<?php
 
namespace app\admin\validate;
use think\Validate; 

class Student extends Validate{
    // 验证规则
    protected $rule = [
        ['name', 'require', '学员名称必须填写'],
        ['phone', 'require|checkPhone|unique:student', '手机号必须填写|请输入正确的手机号|手机号唯一'],
        ['openid','length:28','openid只能28个字符'],
    ];
    protected function checkPhone($value,$rule,$data)
    {
        return checkPhone($data['phone']) ? true : false;
    }
}